package com.trade.services.impl;

import com.trade.data.*;
import com.trade.data.type.*;
import java.util.*;
import com.trade.data.calculation.*;

import com.trade.services.*;
import com.trade.dao.*;


import org.drools.runtime.process.ProcessInstance;

public class DroolFlowService implements IDroolFlowService  {

	private IDroolFlowDAO droolFlowDAO;

	public void setDroolFlowDAO( IDroolFlowDAO droolFlowDAO){
		this.droolFlowDAO = droolFlowDAO;
	}


	/**
	* This method used to add object in Drools Working memory.
	*/
	public void insertObject(Object object, IntervalTimeTypes intervalTimeTypes)throws Exception{
		droolFlowDAO.insertObject(object, intervalTimeTypes);
	}

	public void insertObject(Object object)throws Exception{
		droolFlowDAO.insertObject(object);
	}

	public ProcessInstance startProcess(String processName){
		return droolFlowDAO.startProcess(processName);
	}

	public ProcessInstance startTradeFlowProcess(ProcessFilterVO filterVO){
		return droolFlowDAO.startTradeFlowProcess(filterVO);
	}

	public void fireAllRules(){
		droolFlowDAO.fireAllRules();
	}

	/**
	*	This method return objects from Drool Engine.
	*/

	public List<EquityIntradayDataVO> getEquityIntradayData(Object objects[], IntervalTimeTypes intervalTimeTypes){
		return droolFlowDAO.getEquityIntradayData(objects , intervalTimeTypes);
	}

	public List<MovingAverageValuesVO> getMovingAverageValues(Object objects[], IntervalTimeTypes intervalTimeTypes){
		return droolFlowDAO.getMovingAverageValues(objects , intervalTimeTypes);
	}


	public Double getRSIAverageGain(Object objects[], IntervalTimeTypes intervalTimeTypes){
		return droolFlowDAO.getRSIAverageGain(objects , intervalTimeTypes);
	}
	public Double getRSIAverageLoss(Object objects[], IntervalTimeTypes intervalTimeTypes){
		return droolFlowDAO.getRSIAverageLoss(objects , intervalTimeTypes);
	}


	public List<RSIValuesVO> getRSIValues(Object objects[], IntervalTimeTypes intervalTimeTypes){
		return droolFlowDAO.getRSIValues(objects , intervalTimeTypes);
	}



	public List<CCIValuesVO> getCCIValues(Object objects[], IntervalTimeTypes intervalTimeTypes){
		return droolFlowDAO.getCCIValues(objects , intervalTimeTypes);
	}



	public Double getMACDAverage(Object objects[], IntervalTimeTypes intervalTimeTypes){
		return droolFlowDAO.getMACDAverage(objects , intervalTimeTypes);
	}

	public List<MACDValuesVO> getMACDValues(Object objects[], IntervalTimeTypes intervalTimeTypes){
		return droolFlowDAO.getMACDValues(objects , intervalTimeTypes);
	}

	public List<BollingerBandValuesVO> getBollingerBandValues(Object objects[], IntervalTimeTypes intervalTimeTypes){
		return droolFlowDAO.getBollingerBandValues(objects , intervalTimeTypes);
	}

}